import http from '@/utils/request';
// 获取订单列表
export const getPage = (params: object) => {
	return http.request({
		method: 'GET',
		url: '/mall-order/app/orderinfo/page',
		params,
	});
};
// 获取数量
export const getCount = (params: object) => {
	return http.request({
		method: 'GET',
		url: '/mall-order/app/orderinfo/count',
		params,
		custom: {
			loading: false,
		},
	});
};
// 通过id查询
export const getById = (id: string) => {
	return http.request({
		method: 'GET',
		url: '/mall-order/app/orderinfo/' + id,
	});
};

// 取消订单
export const orderCancel = (id: string) => {
	return http.request({
		method: 'GET',
		url: '/mall-order/app/orderinfo/cancel/' + id,
	});
};
// 删除订单
export const orderDel = (id: string) => {
	return http.request({
		method: 'GET',
		url: '/mall-order/app/orderinfo/del/' + id,
	});
};
//确认收货
export const orderReceiver = (id: string) => {
	return http.request({
		method: 'GET',
		url: '/mall-order/app/orderinfo/receiver/' + id,
	});
};
//创建订单
export const orderCreate = (data: object) => {
	return http.request({
		method: 'POST',
		url: '/mall-order/app/orderinfo/create',
		data,
	});
};
//结算订单
export const orderSettlement = (data: object) => {
	return http.request({
		method: 'POST',
		url: '/mall-order/app/orderinfo/settlement',
		data,
	});
};
//预支付
export const orderPrepay = (data: object) => {
	return http.request({
		method: 'POST',
		url: '/mall-order/app/orderinfo/prepay',
		data,
	});
};
//订单评价
export const orderAppraise = (id: string, data: object) => {
	return http.request({
		method: 'POST',
		url: '/mall-order/app/orderinfo/appraise/' + id,
		data,
	});
};
